package com.yyjj.yyjj.acl.controller;

import com.yyjj.yyjj.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/admin/acl/index")
@RequiredArgsConstructor
@Api(tags = "登录接口")
public class IndexController {
    /**
     * 登录接口
     */
    @ApiOperation("登录")
    @PostMapping("/login")
    public Result login(){
        //返回token值
        Map<String,String> map=new HashMap<>();
        map.put("token","token-admin");
        return Result.ok(map);
    }

    /**
     * 获取用户信息
     */
    @ApiOperation("获取信息")
    @GetMapping("/info")
    public Result info(){
        Map<String,String> map=new HashMap<>();
        map.put("name","admin");
        map.put("avatar","https://img95.699pic.com/photo/40147/9755.gif_wh300.gif");
        return Result.ok(map);
    }

    /**
     * 退出登录
     */
    @ApiOperation("退出")
    @PostMapping("/logout")
    public Result logout(){
        return Result.ok(null);
    }
}
